fix: layout for scrollable content - #127
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an iOS-only bouncesVertically prop to control scroll “bounce” behavior on the underlying UITextView, and updates iOS layout/measurement logic so scrollable vs non-scrollable text views report content size more reliably.
Changes:
- Added
bouncesVerticallyto public TS props, native component props, and both the plain + Reanimated wrappers. - Implemented iOS prop handling (fallback to
bounceson older iOS) and adjusted shadow-node invalidation for content-size changes. - Reworked
InputTextViewsizing to notify size changes viasetContentSize+ a shared size-commit path; added Android no-op setter for parity.
Reviewed changes
Copilot reviewed 9 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Adds bouncesVertically to the public prop interface. |
| src/EnrichedTextInputNativeComponent.ts | Adds bouncesVertically to codegen/native props. |
| src/EnrichedTextInput.tsx | Threads bouncesVertically through the JS wrapper (default true). |
| src/EnrichedReanimatedTextInput.tsx | Threads bouncesVertically through the Reanimated wrapper (default true). |
| ios/EnrichedTextInputView.mm | Applies bouncesVertically to the underlying UITextView / UIScrollView. |
| ios/internals/EnrichedTextInputViewShadowNode.mm | Uses dirtyLayout()-based invalidation on content-size changes. |
| ios/inputTextView/InputTextView.mm | Updates placeholder/layout sizing + size-change notifications. |
| android/src/main/java/com/swmansion/enriched/EnrichedTextInputViewManager.kt | Adds an iOS-only no-op bouncesVertically prop setter. |
| lib/typescript/src/types.d.ts | Generated TS declarations updated for new prop. |
| lib/typescript/src/types.d.ts.map | Generated sourcemap updated. |
| lib/typescript/src/EnrichedTextInputNativeComponent.d.ts | Generated TS declarations updated for native props. |
| lib/typescript/src/EnrichedTextInputNativeComponent.d.ts.map | Generated sourcemap updated. |
| lib/typescript/src/EnrichedTextInput.d.ts | Generated TS declarations updated for wrapper signature. |
| lib/typescript/src/EnrichedTextInput.d.ts.map | Generated sourcemap updated. |
| lib/typescript/src/EnrichedReanimatedTextInput.d.ts | Generated TS declarations updated for Reanimated wrapper signature. |
| lib/typescript/src/EnrichedReanimatedTextInput.d.ts.map | Generated sourcemap updated. |
| lib/module/EnrichedTextInputNativeComponent.ts | Generated module build updated for new native prop. |
| lib/module/EnrichedTextInput.js | Generated module build updated to pass the new prop. |
| lib/module/EnrichedTextInput.js.map | Generated sourcemap updated. |
| lib/module/EnrichedReanimatedTextInput.js | Generated module build updated to pass the new prop. |
| lib/module/EnrichedReanimatedTextInput.js.map | Generated sourcemap updated. |
Files not reviewed (2)
- lib/module/EnrichedReanimatedTextInput.js: Generated file
- lib/module/EnrichedTextInput.js: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+227
to
+242
| BOOL textViewBouncesVertically; | ||
|
|
||
| if (@available(iOS 17.4, *)) { | ||
| textViewBouncesVertically = textView.bouncesVertically; | ||
| } else { | ||
| textViewBouncesVertically = textView.bounces; | ||
| } | ||
|
|
||
| if (newViewProps.bouncesVertically != oldViewProps.bouncesVertically || | ||
| textViewBouncesVertically != newViewProps.bouncesVertically) { | ||
| if (@available(iOS 17.4, *)) { | ||
| textView.bouncesVertically = newViewProps.bouncesVertically; | ||
| } else { | ||
| textView.bounces = newViewProps.bouncesVertically; | ||
| } | ||
| } |
Comment on lines
+202
to
+208
| NSInteger numberOfLines = _placeholderView.numberOfLines; | ||
| _placeholderView.numberOfLines = 1; | ||
| CGFloat height = | ||
| [_placeholderView sizeThatFits:CGSizeMake(width, CGFLOAT_MAX)].height; | ||
| _placeholderView.numberOfLines = numberOfLines; | ||
|
|
||
| return height; |
Comment on lines
3
to
5
| #import <EnrichedTextInputView.h> | ||
| #import <React/RCTShadowView+Layout.h> | ||
| #import <react/utils/ManagedObjectWrapper.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Explain the motivation for making this change: here are some points to help you:
This PR introduces a new prop on iOS that can disable the bouncing for the UITextView. In addition, it improves layout handling for scrollable text views.
Test Plan
Provide clear steps so another contributor can reproduce the behavior or verify the feature works.
For example:
Screenshots / Videos
Screen.Recording.2026-07-20.at.11.05.10.mov
Compatibility